from tkinter import Tk, Label, Button, Canvas

class MainWindow:
    def __init__(self, master):
        self.master = master
        master.title("Desktop")

        self.label = Label(master, text="Desktop on Normal Mode")
        self.label.pack()

        self.greet_button = Button(master, text="Greet", command=self.greet)
        self.greet_button.pack()

        self.quit_button = Button(master, text="Quit", command=master.quit)
        self.quit_button.pack()

        # 创建一个 Canvas 小部件
        self.canvas = Canvas(master, width=400, height=300)
        self.canvas.pack()

        # 在 Canvas 上绘制图形
        self.canvas.create_line(0, 100, 200, 100)
        self.canvas.create_rectangle(50, 25, 150, 75, fill="blue")
        self.canvas.create_oval(100, 100, 200, 200, fill="red")

    def greet(self):
        print("Chinese(按下按钮): Hello!")
        